<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var num = 10;
        var num1 = num;
        num1 = 100;
        console.log(num1);
        console.log(num);
        var arr = [12, 23, 34];
        var arr2 = [];
        for (let i = 0; i < arr.length; i++) {
            arr2.push(arr[i]);
        }
        arr2[0] = "aaa";
        console.log(arr2);
        console.log(arr);
        var obj = {
            name: "lili",
            age: 18,
        }
        var obj2 = {};
        for (var key in obj) {
            obj2[key] = obj[key]
        }
        obj2.name = "nana";
        console.log(obj2);
        console.log(obj);
        var data = [{
            title:"标题1",
            list:["aaa","bbb","ccc"],
            author:{
                name:"lili"
            }
        },{
            title:"标题2",
            list:["a","b","c"],
            author:{
                name:"name"
            }
        }]
        var data2 = [];
        for (let i = 0; i < data.length; i++) {
           var o = {};
           for(var key in data[i]){
            o[key] = data[i][key];
           }
           data2.push(o);
        }
        data2[0].title = "哎哎哎"
        console.log(data2);
        console.log(data);
        data2[0].list[0] = "啊啊啊"
        console.log(data2);
        console.log(data);
    </script>
</body>

</html>